from tkinter import font
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import pickle
import matplotlib as mpl
mpl.rcParams['font.family'] = 'SimSun'
plt.rcParams['axes.unicode_minus'] = False   # 步骤二（解决坐标轴负数的负号显示问题）

with open('Bearing_data_40/Bearing1_3.plk','rb') as tf:
    arr = np.array(pickle.load(tf))
# plt.plot(arr[0,0,:-1])
# plt.show()
# print('')

from mpl_toolkits import mplot3d
import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure()
ax = plt.axes(projection='3d')
for i in range(1,21):
    z = arr[30,i,:-1]
    x = np.linspace(0, 2559, 2560)
    y = np.zeros(2560)+i
    ax.plot3D(x, y, z)


ax.set_zlim(-0.2, 0.2)
ax.set_xlabel('数据长度',fontsize=13)
# ax.set_ylabel('采样索引',fontsize=13)
ax.set_zlabel('振动程度A/g',fontsize=13)
# ax.set_title('3D line plot')

plt.tight_layout()
plt.savefig('{}.svg'.format('数据细节'),dpi=80)
plt.show()
